package org.jeecg.talentCooperation.talent.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.jeecg.talentCooperation.sysdict.po.NdSysDict;
import org.jeecg.talentCooperation.talent.entity.TalentBasic;
import org.jeecg.talentCooperation.talent.mapper.TalentBasicMapper;
import org.jeecg.talentCooperation.talent.model.TalentFruitResultModel;
import org.jeecg.talentCooperation.talent.model.TalentResultModel;
import org.jeecg.talentCooperation.talent.service.ITalentBasicService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;

import java.util.List;

@Service
public class TalentBasicServiceImpl extends ServiceImpl<TalentBasicMapper, TalentBasic> implements ITalentBasicService {

	@Autowired
	private TalentBasicMapper talentBasicMapper;

	@Override
	public List<TalentBasic> getTalentBasicInfoData(TalentBasic talentBasic) {
//		QueryWrapper queryWrapper = new QueryWrapper();
//		if(!ObjectUtils.isEmpty(talentBasic.getId())){
//			queryWrapper.eq("id", talentBasic.getId());
//		}
//		if(!ObjectUtils.isEmpty(talentBasic.getRealName())){
//			queryWrapper.like("real_name", talentBasic.getRealName());
//		}
//		if(!ObjectUtils.isEmpty(talentBasic.getPhoneNumber())){
//			queryWrapper.like("phone_number", talentBasic.getPhoneNumber());
//		}
		return talentBasicMapper.getTalentBasicInfoData(talentBasic);
	}

	@Override
	public List<TalentResultModel> getTalentResearchTrends(TalentBasic talentBasic) {
		return talentBasicMapper.getTalentResearchTrends(talentBasic);
	}

	@Override
	public Page<TalentFruitResultModel> getTalentInfoData(Page<TalentFruitResultModel> page, TalentFruitResultModel talentFruitResultModel) {
		return page.setRecords(talentBasicMapper.getTalentInfoData(page, talentFruitResultModel));
	}

	@Override
	public List<TalentFruitResultModel> getTalentInfoDataOfCooNum(TalentFruitResultModel talentFruitResultModel) {
		return talentBasicMapper.getTalentInfoDataOfCooNum(talentFruitResultModel);
	}

	@Override
	public List<TalentFruitResultModel> getTalentInfoDataOfFruitNum(TalentFruitResultModel talentFruitResultModel) {
		return talentBasicMapper.getTalentInfoDataOfFruitNum(talentFruitResultModel);
	}

	@Override
	public Page<TalentBasic> getTalentInfoList(Page<TalentBasic> page, TalentBasic talentBasic) {
		return page.setRecords(talentBasicMapper.getTalentInfoList(page, talentBasic));
	}
}
